/********************************************
 * 功能说明: 
 * 模块名称: 
 * 系统名称: 
 * 软件版权: 
 * 系统版本: 1.0.0
 * 开发人员: zhangfb
 * 开发时间: 2019/8/31 19:19
 * 审核人员: 
 * 相关文档: 
 * 修改记录: 修改日期 修改人员 修改说明
 *********************************************/
package com.hyacinth.sms.autoconfigure.core;

import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * 短信发送结果
 * @author zhangfb
 * @version 1.0.0.1
 * @since 2019/8/31 19:19
 */
@ToString
@NoArgsConstructor
public class SmsResult {

    private boolean success;
    private String msg;
    private Object result;

    public SmsResult(boolean success) {
        this.success = success;
    }

    public SmsResult(boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }

    public SmsResult(boolean success, Object result) {
        this.success = success;
        this.result = result;
    }

    /**
     * 短信是否发送成功
     */
    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public static SmsResult success() {
        return new SmsResult(true);
    }

    public static SmsResult success(Object object) {
        return new SmsResult(true, object);
    }

    public static SmsResult failure() {
        return new SmsResult(false);
    }

    public static SmsResult failure(String msg) {
        return new SmsResult(false, msg);
    }
}
